From 662b8553d65314132abdfff608418f5df766c7b2 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 10 Jul 2014 12:39:05 -0700 Subject: [PATCH] Fix some tests --- Makefile | 4 +++- tests/test_cargo_compile.rs | 2 +- tests/test_cargo_test.rs | 24 +++++++++++++++--------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 7a422faff..e10fedb1a 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,11 @@ ifeq ($(wildcard rustc/bin),) export RUSTC := rustc else export RUSTC := $(CURDIR)/rustc/bin/rustc +export LD_LIBRARY_PATH := $(CURDIR)/rustc/lib:$(LD_LIBRARY_PATH) +export DYLD_LIBRARY_PATH := $(CURDIR)/rustc/lib:$(DYLD_LIBRARY_PATH) endif -export PATH := $(PATH):$(CURDIR)/rustc/bin +export PATH := $(CURDIR)/rustc/bin:$(PATH) # Link flags to pull in dependencies BINS = cargo \ diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index 54953514c..57ef09ceb 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -1062,7 +1062,7 @@ test!(verbose_release_build_deps { --out-dir {dir}{sep}target{sep}release \ -L {dir}{sep}target{sep}release \ -L {dir}{sep}target{sep}release{sep}deps \ - --extern foo={dir}/target/release/deps/libfoo{hash1}.rlib` + --extern foo={dir}{sep}target{sep}release{sep}deps/libfoo{hash1}.rlib` {compiling} foo v0.0.0 (file:{dir}) {compiling} test v0.0.0 (file:{dir})\n", running = RUNNING, diff --git a/tests/test_cargo_test.rs b/tests/test_cargo_test.rs index ed3f488a4..bdc429a4e 100644 --- a/tests/test_cargo_test.rs +++ b/tests/test_cargo_test.rs @@ -1,4 +1,7 @@ +use std::str; + use support::{project, execs, basic_bin_manifest, COMPILING, cargo_dir}; +use support::{ResultTest}; use hamcrest::{assert_that, existing_file}; use cargo::util::process; @@ -60,23 +63,26 @@ test!(test_with_lib_dep { fn bin_test() {} "); - assert_that(p.cargo_process("cargo-test"), - execs().with_status(0) - .with_stdout(format!("\ -{compiling} foo v0.0.1 (file:{dir}) + let output = p.cargo_process("cargo-test") + .exec_with_output().assert(); + let out = str::from_utf8(output.output.as_slice()).assert(); + let bin = "\ running 1 test test bin_test ... ok -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured - - +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured"; + let lib = "\ running 1 test test lib_test ... ok -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured"; + + let head = format!("{compiling} foo v0.0.1 (file:{dir})", + compiling = COMPILING, dir = p.root().display()); -", compiling = COMPILING, dir = p.root().display()).as_slice())); + assert!(out == format!("{}\n\n{}\n\n\n{}\n\n", head, bin, lib).as_slice() || + out == format!("{}\n\n{}\n\n\n{}\n\n", head, lib, bin).as_slice()); }) test!(test_with_deep_lib_dep { -- 2.30.2